package lab02.test21;

/**
 * Created by ASUS on 2017/10/28.
 */
public class Test {

        public static int counter(String s,char c){

            int count=0;

            for(int i=0;i<s.length();i++){

                if(s.charAt(i)==c){

                    count++;
                }
            }
            return count;
        }
        public static void main(String args[]){

            System.out.println(new Test().counter("LOVELOVEYOU",'O'));
        }
    }
